home *** CD-ROM | disk | FTP | other *** search
/ Revista do CD-ROM 101 / CD-ROM 101.iso / compl / maya5ple / Install_MayaPLE5_English.exe / Maya / Data1.cab / mayaSoftwareSetCommonGlobalV < prev    next >
Encoding:
Text File  |  2003-07-17  |  4.3 KB  |  139 lines

  1. // Copyright (C) 1997-2002 Alias|Wavefront,
  2. // a division of Silicon Graphics Limited.
  3. //
  4. // The information in this file is provided for the exclusive use of the
  5. // licensees of Alias|Wavefront.  Such users have the right to use, modify,
  6. // and incorporate this code into other products for purposes authorized
  7. // by the Alias|Wavefront license agreement, without fee.
  8. //
  9. // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  10. // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
  11. // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  12. // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  13. // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  14. // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  15. // PERFORMANCE OF THIS SOFTWARE.
  16. //
  17. global proc mayaSoftwareSetCommonGlobalValue(
  18.     string $global, 
  19.     string $value)
  20. {
  21.     //
  22.     // Description:
  23.     //    This procedure is called when the current renderer has changed from
  24.     //    some other renderer to the Maya Software renderer. It is called in the
  25.     //    process of copying common global values from the previous renderer to
  26.     //    the Maya Software renderer.
  27.     //    This procedure sets the value of the global specified by $global to the
  28.     //    value specified by $value.
  29.     //    For a complete list of valid values for the $global argument, and to
  30.     //    see how this procedure is used, see copyCommonRenderGlobals.mel.
  31.     //
  32.  
  33.     int $intValue;
  34.     float $floatValue;
  35.     
  36.     switch ($global)
  37.     {
  38.         case "fileNamePrefix":
  39.             setAttr -type "string" defaultRenderGlobals.imageFilePrefix $value;
  40.             break;
  41.         case "animation":
  42.             $intValue = $value;
  43.             setAttr defaultRenderGlobals.animation $intValue;
  44.             break;
  45.         case "startFrame":
  46.             $floatValue = $value;
  47.             setAttr defaultRenderGlobals.startFrame $floatValue;
  48.             break;
  49.         case "endFrame":
  50.             $floatValue = $value;
  51.             setAttr defaultRenderGlobals.endFrame $floatValue;
  52.             break;
  53.         case "byFrame":
  54.             $floatValue = $value;
  55.             setAttr defaultRenderGlobals.byFrameStep $floatValue;
  56.             break;
  57.         case "framePadding":
  58.             $intValue = $value;
  59.             setAttr defaultRenderGlobals.extensionPadding $intValue;
  60.             break;
  61.         case "renderableObjects":
  62.             if ($value == "all")
  63.             {
  64.                 setAttr defaultRenderGlobals.renderAll 1;
  65.             }
  66.             else if ($value == "selected")
  67.             {
  68.                 setAttr defaultRenderGlobals.renderAll 0;
  69.             }
  70.             break;
  71.         case "useCustomExtension":
  72.             if ($value == "1")
  73.             {
  74.                 setAttr defaultRenderGlobals.outFormatControl 2;
  75.             }
  76.             else
  77.             {
  78.                 setAttr defaultRenderGlobals.outFormatControl 0;
  79.             }
  80.             break;
  81.         case "customExtension":
  82.             setAttr -type "string" defaultRenderGlobals.outFormatExt $value;
  83.             break;
  84.         case "renumberFramesUsing":
  85.             $intValue = $value;
  86.             setAttr defaultRenderGlobals.modifyExtension $intValue;
  87.             break;
  88.         case "renumberStartFrame":
  89.             $floatValue = $value;
  90.             setAttr defaultRenderGlobals.startExtension $floatValue;
  91.             break;
  92.         case "renumberByFrame":
  93.             $floatValue = $value;
  94.             setAttr defaultRenderGlobals.byExtension $floatValue;
  95.             break;
  96.         case "maintainWidthHeightRatio":
  97.             $intValue = $value;
  98.             setAttr defaultResolution.aspectLock $intValue;
  99.             break;
  100.         case "width":
  101.             $intValue = $value;
  102.             setAttr defaultResolution.width $intValue;
  103.             break;
  104.         case "height":
  105.             $intValue = $value;
  106.             setAttr defaultResolution.height $intValue;
  107.             break;
  108.         case "lockDeviceAspectRatio":
  109.             $intValue = $value;
  110.             setAttr defaultResolution.lockDeviceAspectRatio $intValue;
  111.             break;
  112.         case "deviceAspectRatio":
  113.             $floatValue = $value;
  114.             setAttr defaultResolution.deviceAspectRatio $floatValue;
  115.             break;
  116.         case "pixelAspectRatio":
  117.             //
  118.             // We do not store pixel aspect ratio.  Only device aspect
  119.             // ratio is stored.
  120.             //
  121.             break;
  122.         case "enableDefaultLight":
  123.             $intValue = $value;
  124.             setAttr defaultRenderGlobals.enableDefaultLight $intValue;
  125.             break;
  126.         case "pluginFormat":
  127.             setAttr -type "string" defaultRenderGlobals.pluginFormat $value;
  128.             break;
  129.         case "preRenderMel":
  130.             if(!`about -evalVersion`)
  131.                 setAttr -type "string" defaultRenderGlobals.preRenderMel $value;
  132.             break;
  133.         case "postRenderMel":
  134.             if(!`about -evalVersion`)
  135.                 setAttr -type "string" defaultRenderGlobals.postRenderMel $value;
  136.             break;
  137.     }
  138. }
  139.